// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   BalanceSummaryProcessor.java

package com.boci.clientapp.trading.processor;

import com.boci.clientapp.trading.vo.BalanceSummaryVO;
import com.boci.common.processor.AbstractResponseProcessor;
import com.boci.common.vo.ResponseVO;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;

public class BalanceSummaryProcessor extends AbstractResponseProcessor
{

    public BalanceSummaryProcessor(String pXML, String pReqType)
        throws Exception
    {
        super(pXML, pReqType, "BALANCE.ERROR_");
    }

    public ResponseVO processXML()
        throws Exception
    {
        String strReqType = null;
        String strRtnCode = null;
        String strCcyCode = null;
        String strConBuyPower = null;
        String strBuyPowerQualSec = null;
        strReqType = getReqType();
        strRtnCode = getReturnCode();
        BalanceSummaryVO balSummaryVO = new BalanceSummaryVO(strReqType, strRtnCode);
        NodeList conNodes = resultDocument.getElementsByTagName("CONSOLIDATED_CASH_HOLDING");
        if(conNodes == null || conNodes.getLength() <= 0)
            strCcyCode = "";
        else
            strCcyCode = getAttrValue(conNodes.item(0), "CURRENCY");
        strConBuyPower = getNodeValue("CONSOLIDATED_BUYING_POWER");
        strBuyPowerQualSec = getNodeValue("BUYING_POWER_QUALIFIED_SEC");
        balSummaryVO.setCcyCode(strCcyCode);
        balSummaryVO.setConBuyPower(strConBuyPower);
        balSummaryVO.setBuyPowerQualSec(strBuyPowerQualSec);
        return balSummaryVO;
    }
}
